package com.metronoteapp.dialog;

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.metronoteapp.AddNoteActivity;
import com.metronoteapp.CameraActivity;
import com.metronoteapp.GroupExpActivity;
import com.metronoteapp.R;
import com.metronoteapp.database.GroupNoteDao;
import com.metronoteapp.database.NoteDao;
import com.metronoteapp.model.GroupModel;
import com.metronoteapp.model.NoteModel;
import com.metronoteapp.until.Constants;

public class DialogMenuClient extends Dialog implements
		android.view.View.OnClickListener {
	private String TAG = DialogMenuClient.class.getSimpleName();
	private Context mContext;
	private Dialog dialog;
	private Button btnTextNote;
	private Button btnImageNote;
	private Button btnVideoNote;
	private Button btnCancel;

	public DialogMenuClient(Context context) {
		super(context);
		mContext = context;
	}

	public void displaydialog() {
		dialog = new Dialog(mContext);
		dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
		dialog.setContentView(R.layout.layout_dialog_list_menu);
		// dialog.getWindow().getAttributes().windowAnimations =
		// R.style.Animations_SmileWindow;
		dialog.getWindow().getAttributes().windowAnimations = R.style.DialogAnimation;
		btnTextNote = (Button) dialog.findViewById(R.id.btnTextNote);
		btnImageNote = (Button) dialog.findViewById(R.id.btnImageNote);
		btnVideoNote = (Button) dialog.findViewById(R.id.btnVideoNote);
		btnCancel = (Button) dialog.findViewById(R.id.btnCancel);
		btnTextNote.setOnClickListener(this);
		btnImageNote.setOnClickListener(this);
		btnVideoNote.setOnClickListener(this);
		btnCancel.setOnClickListener(this);
		dialog.show();
	}

	/*
	 * This function parse cursor
	 */
	private static String getColumnAsString(Cursor cursor, int index) {
		return cursor.getString(index).trim();
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btnTextNote:
			Intent callAddNote = new Intent(mContext, AddNoteActivity.class);
			callAddNote.putExtra("NoteId", "");
			callAddNote.putExtra("FlgImp", "0");
			mContext.startActivity(callAddNote);
			break;
		case R.id.btnImageNote:
			Intent callAddImage = new Intent(mContext, CameraActivity.class);
			callAddImage.putExtra("FlgImp", "0");
			mContext.startActivity(callAddImage);
			break;
		case R.id.btnVideoNote:

			break;
		case R.id.btnCancel:
			dialog.dismiss();
			break;
		default:
			break;
		}
	}
}
